#include <stdio.h>

unsigned int my_strlen(const char *str)
{
    int length = 0;
    while(*str != '\0')
    {
        length++;
        str++;
    }
    return length;
}

char *find_longest_string(char * string[],int size)
{
    if(size <= 0)
        return NULL;
    
    char *longest_string = string[0];
    int count = my_strlen(string[0]);
    for(int i = 1; i < size; i++)
    {
        if(count < my_strlen(string[i]))
        {
            longest_string = string[i];
            count = my_strlen(string[i]);
        }
    }
    return longest_string;
}
int main(int argc, char const *argv[])
{
    char * arr[] = {"abcd","apple","asdfgh","qw","jkl","zxcvbn"};
    int size = sizeof(arr)/sizeof(arr[0]);

    printf("%s\n",find_longest_string(arr,size));

    
    return 0;
}
